 namespace if = "http://namespaces.xmlschemata.org/xvif/iframe"
 namespace rng = "http://relaxng.org/ns/structure/1.0"
 
 datatypes d = "http://relaxng.org/ns/compatibility/datatypes/1.0"
 
 born-element =
   [
     if:pipe [
       if:validate [
         type = "http://namespaces.xmlschemata.org/xvif/regexp"
         apply = "m/[0-9]+ .+ [0-9]+/"
       ]
       if:transform [
         type = "http://namespaces.xmlschemata.org/xvif/regexp"
         apply = "s/^[ \t\n]*([0-9] .*)$/0\1/"
       ]
       if:transform [
         type = "http://namespaces.xmlschemata.org/xvif/regexp"
         apply = "s/([0-9]+) janvier ([0-9]+)/\2-01-\1/"
       ]
       if:transform [
         type = "http://namespaces.xmlschemata.org/xvif/regexp"
         apply = "s/([0-9]+) fevrier ([0-9]+)/\2-02-\1/"
       ]
       if:transform [
         type = "http://namespaces.xmlschemata.org/xvif/regexp"
         apply = "s/([0-9]+) mars ([0-9]+)/\2-03-\1/"
       ]
       if:transform [
         type = "http://namespaces.xmlschemata.org/xvif/regexp"
         apply = "s/([0-9]+) avril ([0-9]+)/\2-04-\1/"
       ]
       if:transform [
         type = "http://namespaces.xmlschemata.org/xvif/regexp"
         apply = "s/([0-9]+) mai ([0-9]+)/\2-05-\1/"
       ]
       if:transform [
         type = "http://namespaces.xmlschemata.org/xvif/regexp"
         apply = "s/([0-9]+) juin ([0-9]+)/\2-06-\1/"
       ]
       if:transform [
         type = "http://namespaces.xmlschemata.org/xvif/regexp"
         apply = "s/([0-9]+) juillet ([0-9]+)/\2-07-\1/"
       ]
       if:transform [
         type = "http://namespaces.xmlschemata.org/xvif/regexp"
         apply = "s/([0-9]+) aout ([0-9]+)/\2-08-\1/"
       ]
       if:transform [
         type = "http://namespaces.xmlschemata.org/xvif/regexp"
         apply = "s/([0-9]+) septembre ([0-9]+)/\2-09-\1/"
       ]
       if:transform [
         type = "http://namespaces.xmlschemata.org/xvif/regexp"
         apply = "s/([0-9]+) octobre ([0-9]+)/\2-10-\1/"
       ]
       if:transform [
         type = "http://namespaces.xmlschemata.org/xvif/regexp"
         apply = "s/([0-9]+) novembre ([0-9]+)/\2-11-\1/"
       ]
       if:transform [
         type = "http://namespaces.xmlschemata.org/xvif/regexp"
         apply = "s/([0-9]+) decembre ([0-9]+)/\2-12-\1/"
       ]
       if:validate [
         type = "http://relaxng.org/ns/structure/1.0"
         if:apply [
           rng:data [
             type = "date"
             rng:param [ name = "minInclusive" "1900-01-01" ]
             rng:param [ name = "maxInclusive" "2099-12-31" ]
             rng:param [ name = "pattern" "[0-9]{4}-[0-9]{2}-[0-9]{2}" ]
           ]
         ]
       ]
     ]
   ]
   element born { [ if:ignore = "1" ] text }
 start =
   element library {
     element book {
       attribute id { d:ID },
       attribute available { xsd:boolean },
       element isbn {
         xsd:NMTOKEN { pattern = "[0-9]{9}[0-9x]" }
       },
       element title {
         attribute xml:lang {
           xsd:language { length = "2" }
         },
         xsd:token { maxLength = "255" }
       },
       element author {
         attribute id { d:ID },
         element name {
           xsd:token { maxLength = "255" }
         },
         born-element,
         element dead {
           xsd:date {
             minInclusive = "1900-01-01"
             maxInclusive = "2099-12-31"
             pattern = "[0-9]{4}-[0-9]{2}-[0-9]{2}"
           }
         }?
       }*,
       element character {
         attribute id { d:ID },
         element name {
           xsd:token { maxLength = "255" }
         },
         born-element,
         element qualification {
           xsd:token { maxLength = "255" }
         }
       }*
     }+
   }
